<!--
* @Description: 流程设计模型部署表 - 表单
* @Author: DHL
* @Date: 2022-08-23 15:26:03
 * @LastEditors: DHL
 * @LastEditTime: 2022-08-23 17:29:47
-->
<template>
  <tw-dialog
    v-model="visible"
    :title="title"
    :loading="loading"
    width="600px"
    height="300px"
    @close="handleClose"
  >
    <el-form
      ref="dbFormRef"
      :model="dbForm"
      :rules="rules"
      label-width="90px"
      :disabled="action === 'view'"
    >
      <el-form-item label="分类" prop="category">
        <el-cascader
          v-model="state.category"
          :options="treeData"
          :props="{ checkStrictly: true, value: 'code', label: 'name', children: 'children' }"
          filterable
          clearable
          placeholder="请选择分类"
        />
      </el-form-item>

      <el-form-item label="名称" prop="name">
        <el-input v-model="dbForm.name" clearable placeholder="请输入名称"></el-input>
      </el-form-item>

      <el-form-item label="唯一编码" prop="key">
        <el-input v-model="dbForm.key" clearable placeholder="请输入唯一编码"></el-input>
      </el-form-item>

      <el-form-item label="描述" prop="description">
        <el-input
          v-model="dbForm.description"
          clearable
          placeholder="请输入描述"
          type="textarea"
        ></el-input>
      </el-form-item>
    </el-form>

    <template #footer>
      <el-button @click="handleReset(true)">取 消</el-button>
      <el-button v-if="action === 'add'" type="warning" @click="handleSubmit(true)">
        提交并继续
      </el-button>
      <el-button v-if="action !== 'view'" type="primary" @click="handleSubmit(false)">
        提 交
      </el-button>
    </template>
  </tw-dialog>
</template>

<script src="./useForm.ts"></script>

<style scoped lang="scss"></style>
